class Nl2br extends React.Component {
    render(){
        const str=this.props.children;
        if(str){
            const exp=new RegExp(this.props.split||'\n', 'g');
            return <div dangerouslySetInnerHTML={{__html:str.replace(exp, '<br/>')}}></div>
        }
        return str||<div></div>
    }
}

Nl2br.propTypes={
    split:React.PropTypes.string
};

module.exports = Nl2br;